<template>
  <div class="banner">
    <img :src="currentCategory.img_url" alt="" />
    <span>{{ currentCategory.front_name }}</span>
    <div class="mytitle">
      <span></span>
      <h3>{{ currentCategory.name }}分类</h3>
    </div>
    <!-- 商品宫格 -->
    <van-grid :column-num="3">
      <van-grid-item
        v-for="item in currentCategory.subCategoryList"
        :key="item.id"
        :icon="item.wap_banner_url"
        :text="item.name"
      />
    </van-grid>
  </div>
</template>
 
<script>
export default {
  props: ["currentCategory"],
  data() {
    return {};
  },
};
</script>
 
<style lang = "less" scoped>
.banner {
  width: 95%;
  margin: 0 auto;
  position: relative;
  img {
    width: 100%;
    height: 10rem;
    display: block;
    border-radius: 5px;
    box-shadow: 0 0 6px #000;
    -webkit-filter: brightness(0.5);
    filter: brightness(0.5);
  }
  span {
    position: absolute;
    left: 0;
    top: 0;
    color: #fff;
    width: 100%;
    text-align: center;
    line-height: 10rem;
  }
  .mytitle {
    background: #fff;
    height: 50px;
    line-height: 50px;
    position: relative;
    span {
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto;
      height: 2px;
      width: 50%;
      background: #ccc;
    }
    h3 {
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto;
      width: 30%;
      background: #fff;
      text-align: center;
    }
  }
}
</style>